package com.pro.service.imple;

import com.pro.mapper.JsCourseRecordMapper;
import com.pro.pojo.JsCourseRecord;
import com.pro.service.JsCourseRecordService;
import com.pro.utils.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * ClassName:JsCourseRecordServiceImple
 * Package:com.pro.service.imple
 * Description:
 *
 * @Date:2022/1/13 20:37
 * @Author: ZPT
 */
@Service
public class JsCourseRecordServiceImple implements JsCourseRecordService {
    @Autowired(required = false)
    private JsCourseRecordMapper courseRecordMapper;
    /**
     *
     * @author ZPT
     * @date 2022/1/13 20:36
     * @content :添加审核
     */
    @Override
    public Boolean addRecord(JsCourseRecord courseRecord) {
        courseRecord.setApplyDate(new Date());
        return courseRecordMapper.addRecord(courseRecord);
    }
    /**
     *
     * @author ZPT
     * @date 2022/1/14 16:15
     * @content :查询课程审核数据
     */
    @Override
    public List<JsCourseRecord> getRecord(JsCourseRecord courseRecord){
        return courseRecordMapper.getRecord(courseRecord);
    }
    /**
     *
     * @author ZPT
     * @date 2022/1/14 18:43
     * @content :查询各个状态对应的数量
     */
    @Override
    public Integer recordCount(String result,Integer type){
        return courseRecordMapper.recordCount(result,type);
    }
    /**
     *
     * @author ZPT
     * @date 2022/1/14 20:47
     * @content :修改审核结果
     */
    @Override
    public Boolean updateRecordResult(JsCourseRecord courseRecord){
        courseRecord.setImplementDate(new Date());
        return courseRecordMapper.updateRecordResult(courseRecord);
    }
    /**
     *
     * @author ZPT
     * @date 2022/1/15 9:52
     * @content :查看微圈审核数据
     */
    @Override
    public List<JsCourseRecord> getMicrocircleRecord(JsCourseRecord courseRecord) {
        return courseRecordMapper.getMicrocircleRecord(courseRecord);
    }
    /**
     *
     * @author ZPT
     * @date 2022/1/19 18:05
     * @content :删除审核数据
     */
    @Override
    public Boolean deleteRecord(Integer courseId,Integer type){
        return courseRecordMapper.deleteRecord(courseId,type);
    }
}
